package ecg.util;

import java.io.IOException;
import java.io.Reader;
import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

public class SqlMapLocator
{
	public static SqlMapClient getMapper()
	{
		SqlMapClient sqlMapper;
		try{
			Reader reader = Resources.getResourceAsReader("SqlMapConfig.xml");
			sqlMapper = SqlMapClientBuilder.buildSqlMapClient(reader);
			reader.close();
		}catch(IOException ex){
			throw new RuntimeException("SqlMapClient 객체 생성 중 에러발생: " + ex, ex);
		}
		
		return sqlMapper;
	}
}
